package gameObject
{
	import flash.events.Event;
	import flash.net.Responder;
	
	import gameObject.resources3D.GameMesh;
	import gameObject.resources3D.WeaponResource;
	
	/**
	 * 战斗中玩家的低模武器
	 */	
	public class WeaponSec extends GameObjectBase
	{
		private var _pid:int;
		
		private var _dur:int;
		private var _maxDur:int;
		private var _bullet:int;
		private var _speed:Number;
		private var _pow:int;
		
		public function WeaponSec(pid:int)
		{
			Global.phpServer.call("robotServer.getSecWeapon", new Responder(gotValue),pid);
		}
		
		public function get pid():int
		{
			return _pid;
		}

		private function gotValue(obj:Object):void
		{
			_pid = obj.pid;
			_dur = obj.dur;
			_maxDur = obj.maxdur;
			_bullet = obj.bullet;
			_speed = obj.speed;
			_pow = obj.pow;
			
			_resource = new WeaponResource(2,obj.id,GameMesh.LOD_LOW);
			_resource.addEventListener(Event.COMPLETE,onResourceLoaded);
			_resource.load();
		}
		
		private function onResourceLoaded(e:Event):void
		{
			addChild(_resource);
			dispatchEvent(new Event(Event.COMPLETE));
		}
			
	}
}